<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>通过name属性查找</title>
</head>
<body>
<form>
	<input type="radio" name="sex" value="male">男
	<input type="radio" name="sex" value="famale">女
	<input type="radio" name="sex" value="yao">人妖
</form>
<script type="text/javascript">
// 属性查找
var radios = document.getElementsByName('sex');
radios[2].checked = true;
</script>
</body>
</html>